package demo01;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class work05 {
	public static void main(String[] args) {
		int [] arr1= {1,2,3};
		int [] arr2 = {2,3,4,5};
		
		Map<Integer,Integer> map = Stream.concat(Arrays.stream(arr1).boxed(), Arrays.stream(arr2).boxed())
				.collect(Collectors.toMap(s->s, s->1,Integer::sum));
		map.keySet().stream().filter(s->map.get(s)==1).forEach(s->System.out.print(s+" "));
	}
}
